<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>y商品评论页</title>
  <link rel="stylesheet" href="./font_4090654_muxi9r0zi3d/iconfont.css">
  <link rel="stylesheet" href="./css/智慧商城.css">
  <style>
    .pingjia ul li .active {
      color: red;
    }
  </style>
</head>

<body>
  <div class="header">
    <span class="iconfont icon-xiaoyufuhao"></span>
    <div class="tou">

      <h3>商品评价页</h3>
    </div>
  </div>
  <div class="pingjia">
    <ul>
      <li><a href="#" class="active" data-index="0">全部(5)</a></li>
      <li><a href="#" data-index="1">好评(5)</a></li>
      <li><a href="#" data-index="2">中评(0)</a></li>
      <li><a href="#" data-index="3">差评(0)</a></li>
    </ul>
  </div>
  <div class="weiwei"></div>

  <div class="dada">
    <!-- <div class="touxiang">
      <div class="touxiangkuang1">
        <div class="hezi">
          <img src="./img/default-avatar.png" alt="">
          <span>189****8139</span>
          <span class="iconfont icon-xingxing"></span>
          <span class="iconfont icon-xingxing"></span>
          <span class="iconfont icon-xingxing"></span>
          <span class="iconfont icon-xingxing"></span>
          <span class="iconfont icon-xingxing"></span>
        </div>
        <div class="hezi2">
          <span class="for">2023-04-03 18:43:14</span>
        </div>


      </div>
    </div>
    <div class="neirong">
      <div class="neirong1">
        <p>666</p>
      </div>
    </div>
    <div class="box3">
      <img src="" alt="">
    </div> -->
  </div>




  <!-- js -->
  <script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
  <script>

    //获取服务器数据
    const goodsId = JSON.parse(localStorage.getItem('shouji'))
    console.log(goodsId);
    // 点屏幕左上角箭头  跳转到商品详情页
    document.querySelector('.icon-xiaoyufuhao').addEventListener('click', function () {
      location.href = '../智慧商城，商品详情/商品详情.html'
    })
    // 给tab栏注册点击事件--事件委托
    document.querySelector('.pingjia ul').addEventListener('click', function (e) {
      if (e.target.tagName === 'A') {

        // 获取当前被点击元素的位置
        // console.log(e.target.offsetLeft)
        // 让line平移到被点击元素的位置
        const active = document.querySelector('.pingjia ul li .active')
        active.classList.remove('active')
        e.target.classList.add('active')

        document.querySelector('.weiwei').style.transform = `translateX(${(e.target.offsetLeft - 29)}px)`


      }
    })
    // 首屏渲染
    async function shoupin() {
      const quanbu = await axios({ url: `http://cba.itlike.com/public/index.php?s=/api/comment/list&scoreType=-1&goodsId=${goodsId}&page=1` })
      console.log(quanbu.data.data.list.data)
      document.querySelector('.dada').innerHTML = quanbu.data.data.list.data.map(function (item) {
        if (item.images.length === 1) {
          if (item.score == 10) {
            return ` <div class="touxiang">
        <div class="touxiangkuang1">
          <div class="hezi">
            <img src="./img/default-avatar.png" alt="">
            <span>${item.user.nick_name}</span>
            <span class="iconfont icon-xingxing"></span>
            <span class="iconfont icon-xingxing"></span>
            <span class="iconfont icon-xingxing"></span>
            <span class="iconfont icon-xingxing"></span>
            <span class="iconfont icon-xingxing"></span>
          </div>
          <div class="hezi2">
            <span class="for">${item.create_time}</span>
          </div>

        </div>
      </div>
      <div class="neirong">
        <div class="neirong1">
          <p>${item.content}</p>
        </div>
      </div>
      <div class="box3">
        <img src=${item.images.length === 1 ? item.images[0].image_url : ""} alt="">
      </div>`
          }
          else if (item.score == 20) {
            return ` <div class="touxiang">
        <div class="touxiangkuang1">
          <div class="hezi">
            <img src="./img/default-avatar.png" alt="">
            <span>${item.user.nick_name}</span>
            <span class="iconfont icon-xingxing"></span>
            <span class="iconfont icon-xingxing"></span>
            <span class="iconfont icon-xingxing"></span>
         
          </div>
          <div class="hezi2">
            <span class="for">${item.create_time}</span>
          </div>

        </div>
      </div>
      <div class="neirong">
        <div class="neirong1">
          <p>${item.content}</p>
        </div>
      </div>
      <div class="box3">
        <img src=${item.images.length === 1 ? item.images[0].image_url : ""}  alt="">
      </div>`
          } else {
            return ` <div class="touxiang">
        <div class="touxiangkuang1">
          <div class="hezi">
            <img src="./img/default-avatar.png" alt="">
            <span>${item.user.nick_name}</span>
            <span class="iconfont icon-xingxing"></span>
  
          </div>
          <div class="hezi2">
            <span class="for">${item.create_time}</span>
          </div>

        </div>
      </div>
      <div class="neirong">
        <div class="neirong1">
          <p>${item.content}</p>
        </div>
      </div>
      <div class="box3">

        <img src=${item.images.length === 1 ? item.images[0].image_url : ""}  alt="">
      </div>`
          }


        } else {

          if (item.score == 10) {
            return ` <div class="touxiang">
        <div class="touxiangkuang1">
          <div class="hezi">
            <img src="./img/default-avatar.png" alt="">
            <span>${item.user.nick_name}</span>
            <span class="iconfont icon-xingxing"></span>
            <span class="iconfont icon-xingxing"></span>
            <span class="iconfont icon-xingxing"></span>
            <span class="iconfont icon-xingxing"></span>
            <span class="iconfont icon-xingxing"></span>
          </div>
          <div class="hezi2">
            <span class="for">${item.create_time}</span>
          </div>

        </div>
      </div>
      <div class="neirong">
        <div class="neirong1">
          <p>${item.content}</p>
        </div>
      </div>
      <div class="box3"></div>
    `
          }
          else if (item.score == 20) {
            return ` <div class="touxiang">
        <div class="touxiangkuang1">
          <div class="hezi">
            <img src="./img/default-avatar.png" alt="">
            <span>${item.user.nick_name}</span>
            <span class="iconfont icon-xingxing"></span>
            <span class="iconfont icon-xingxing"></span>
            <span class="iconfont icon-xingxing"></span>
         
          </div>
          <div class="hezi2">
            <span class="for">${item.create_time}</span>
          </div>

        </div>
      </div>
      <div class="neirong">
        <div class="neirong1">
          <p>${item.content}</p>
        </div>
      </div>
      <div class="box3"></div>
      `
          } else {
            return ` <div class="touxiang">
        <div class="touxiangkuang1">
          <div class="hezi">
            <img src="./img/default-avatar.png" alt="">
            <span>${item.user.nick_name}</span>
            <span class="iconfont icon-xingxing"></span>
  
          </div>
          <div class="hezi2">
            <span class="for">${item.create_time}</span>
          </div>

        </div>
      </div>
      <div class="neirong">
        <div class="neirong1">
          <p>${item.content}</p>
        </div>
      </div>
      <div class="box3" style="height:5vw;"></div>
      `
          }
        }
      }).join('')
    }
    shoupin()
    // 获取商品评价总数
    async function ping() {
      const zongshu = await axios({
        url: `http://cba.itlike.com/public/index.php?s=/api/comment/total&goodsId=${goodsId}`
      })
      // console.log(zongshu)
      // console.log(zongshu.data.data.total)
      document.querySelectorAll('.pingjia a')[0].innerHTML = `全部(${zongshu.data.data.total.all})`
      document.querySelectorAll('.pingjia a')[1].innerHTML = `好评(${zongshu.data.data.total.praise})`
      document.querySelectorAll('.pingjia a')[2].innerHTML = `中评(${zongshu.data.data.total.review})`
      document.querySelectorAll('.pingjia a')[3].innerHTML = `差评(${zongshu.data.data.total.negative})`

      // 获取商品评论
      const pinglun = await axios({ url: `http://cba.itlike.com/public/index.php?s=/api/comment/listRows&goodsId=${goodsId}&limit=${zongshu.data.data.total.all}` })
      // console.log(pinglun)
      // console.log(pinglun.data.data.list)

      // const pinglunlun = pinglun.data.data.list

      // 渲染 全部
      document.querySelectorAll('.pingjia ul li a')[0].addEventListener('click', async function () {
        const quanbu = await axios({ url: `http://cba.itlike.com/public/index.php?s=/api/comment/list&scoreType=-1&goodsId=${goodsId}&page=1` })
        console.log(quanbu.data.data.list.data)
        document.querySelector('.dada').innerHTML = quanbu.data.data.list.data.map(function (item) {
          if (item.images.length === 1) {
            if (item.score == 10) {
              return ` <div class="touxiang">
        <div class="touxiangkuang1">
          <div class="hezi">
            <img src="./img/default-avatar.png" alt="">
            <span>${item.user.nick_name}</span>
            <span class="iconfont icon-xingxing"></span>
            <span class="iconfont icon-xingxing"></span>
            <span class="iconfont icon-xingxing"></span>
            <span class="iconfont icon-xingxing"></span>
            <span class="iconfont icon-xingxing"></span>
          </div>
          <div class="hezi2">
            <span class="for">${item.create_time}</span>
          </div>

        </div>
      </div>
      <div class="neirong">
        <div class="neirong1">
          <p>${item.content}</p>
        </div>
      </div>
      <div class="box3">
        <img src=${item.images.length === 1 ? item.images[0].image_url : ""} alt="">
      </div>`
            }
            else if (item.score == 20) {
              return ` <div class="touxiang">
        <div class="touxiangkuang1">
          <div class="hezi">
            <img src="./img/default-avatar.png" alt="">
            <span>${item.user.nick_name}</span>
            <span class="iconfont icon-xingxing"></span>
            <span class="iconfont icon-xingxing"></span>
            <span class="iconfont icon-xingxing"></span>
         
          </div>
          <div class="hezi2">
            <span class="for">${item.create_time}</span>
          </div>

        </div>
      </div>
      <div class="neirong">
        <div class="neirong1">
          <p>${item.content}</p>
        </div>
      </div>
      <div class="box3">
        <img src=${item.images.length === 1 ? item.images[0].image_url : ""}  alt="">
      </div>`
            } else {
              return ` <div class="touxiang">
        <div class="touxiangkuang1">
          <div class="hezi">
            <img src="./img/default-avatar.png" alt="">
            <span>${item.user.nick_name}</span>
            <span class="iconfont icon-xingxing"></span>
  
          </div>
          <div class="hezi2">
            <span class="for">${item.create_time}</span>
          </div>

        </div>
      </div>
      <div class="neirong">
        <div class="neirong1">
          <p>${item.content}</p>
        </div>
      </div>
      <div class="box3">

        <img src=${item.images.length === 1 ? item.images[0].image_url : ""}  alt="">
      </div>`
            }


          } else {

            if (item.score == 10) {
              return ` <div class="touxiang">
        <div class="touxiangkuang1">
          <div class="hezi">
            <img src="./img/default-avatar.png" alt="">
            <span>${item.user.nick_name}</span>
            <span class="iconfont icon-xingxing"></span>
            <span class="iconfont icon-xingxing"></span>
            <span class="iconfont icon-xingxing"></span>
            <span class="iconfont icon-xingxing"></span>
            <span class="iconfont icon-xingxing"></span>
          </div>
          <div class="hezi2">
            <span class="for">${item.create_time}</span>
          </div>

        </div>
      </div>
      <div class="neirong">
        <div class="neirong1">
          <p>${item.content}</p>
        </div>
      </div>
      <div class="box3"></div>
    `
            }
            else if (item.score == 20) {
              return ` <div class="touxiang">
        <div class="touxiangkuang1">
          <div class="hezi">
            <img src="./img/default-avatar.png" alt="">
            <span>${item.user.nick_name}</span>
            <span class="iconfont icon-xingxing"></span>
            <span class="iconfont icon-xingxing"></span>
            <span class="iconfont icon-xingxing"></span>
         
          </div>
          <div class="hezi2">
            <span class="for">${item.create_time}</span>
          </div>

        </div>
      </div>
      <div class="neirong">
        <div class="neirong1">
          <p>${item.content}</p>
        </div>
      </div>
      <div class="box3"></div>
      `
            } else {
              return ` <div class="touxiang">
        <div class="touxiangkuang1">
          <div class="hezi">
            <img src="./img/default-avatar.png" alt="">
            <span>${item.user.nick_name}</span>
            <span class="iconfont icon-xingxing"></span>
  
          </div>
          <div class="hezi2">
            <span class="for">${item.create_time}</span>
          </div>

        </div>
      </div>
      <div class="neirong">
        <div class="neirong1">
          <p>${item.content}</p>
        </div>
      </div>
      <div class="box3" style="height:5vw;"></div>
      `
            }
          }
        }).join('')
      })
      // 渲染  好评
      document.querySelectorAll('.pingjia ul li a')[1].addEventListener('click', async function () {
        const quanbu = await axios({ url: `http://cba.itlike.com/public/index.php?s=/api/comment/list&scoreType=10&goodsId=${goodsId}&page=1` })
        console.log(quanbu.data.data.list.data)
        document.querySelector('.dada').innerHTML = quanbu.data.data.list.data.map(function (item) {
          if (item.images.length === 1) {
            if (item.score == 10) {
              return ` <div class="touxiang">
        <div class="touxiangkuang1">
          <div class="hezi">
            <img src="./img/default-avatar.png" alt="">
            <span>${item.user.nick_name}</span>
            <span class="iconfont icon-xingxing"></span>
            <span class="iconfont icon-xingxing"></span>
            <span class="iconfont icon-xingxing"></span>
            <span class="iconfont icon-xingxing"></span>
            <span class="iconfont icon-xingxing"></span>
          </div>
          <div class="hezi2">
            <span class="for">${item.create_time}</span>
          </div>

        </div>
      </div>
      <div class="neirong">
        <div class="neirong1">
          <p>${item.content}</p>
        </div>
      </div>
      <div class="box3">
        <img src=${item.images.length === 1 ? item.images[0].image_url : ""} alt="">
      </div>`
            }
            else if (item.score == 20) {
              return ` <div class="touxiang">
        <div class="touxiangkuang1">
          <div class="hezi">
            <img src="./img/default-avatar.png" alt="">
            <span>${item.user.nick_name}</span>
            <span class="iconfont icon-xingxing"></span>
            <span class="iconfont icon-xingxing"></span>
            <span class="iconfont icon-xingxing"></span>
         
          </div>
          <div class="hezi2">
            <span class="for">${item.create_time}</span>
          </div>

        </div>
      </div>
      <div class="neirong">
        <div class="neirong1">
          <p>${item.content}</p>
        </div>
      </div>
      <div class="box3">
        <img src=${item.images.length === 1 ? item.images[0].image_url : ""}  alt="">
      </div>`
            } else {
              return ` <div class="touxiang">
        <div class="touxiangkuang1">
          <div class="hezi">
            <img src="./img/default-avatar.png" alt="">
            <span>${item.user.nick_name}</span>
            <span class="iconfont icon-xingxing"></span>
  
          </div>
          <div class="hezi2">
            <span class="for">${item.create_time}</span>
          </div>

        </div>
      </div>
      <div class="neirong">
        <div class="neirong1">
          <p>${item.content}</p>
        </div>
      </div>
      <div class="box3">

        <img src=${item.images.length === 1 ? item.images[0].image_url : ""}  alt="">
      </div>`
            }


          } else {

            if (item.score == 10) {
              return ` <div class="touxiang">
        <div class="touxiangkuang1">
          <div class="hezi">
            <img src="./img/default-avatar.png" alt="">
            <span>${item.user.nick_name}</span>
            <span class="iconfont icon-xingxing"></span>
            <span class="iconfont icon-xingxing"></span>
            <span class="iconfont icon-xingxing"></span>
            <span class="iconfont icon-xingxing"></span>
            <span class="iconfont icon-xingxing"></span>
          </div>
          <div class="hezi2">
            <span class="for">${item.create_time}</span>
          </div>

        </div>
      </div>
      <div class="neirong">
        <div class="neirong1">
          <p>${item.content}</p>
        </div>
      </div>
      <div class="box3"></div>
    `
            }
            else if (item.score == 20) {
              return ` <div class="touxiang">
        <div class="touxiangkuang1">
          <div class="hezi">
            <img src="./img/default-avatar.png" alt="">
            <span>${item.user.nick_name}</span>
            <span class="iconfont icon-xingxing"></span>
            <span class="iconfont icon-xingxing"></span>
            <span class="iconfont icon-xingxing"></span>
         
          </div>
          <div class="hezi2">
            <span class="for">${item.create_time}</span>
          </div>

        </div>
      </div>
      <div class="neirong">
        <div class="neirong1">
          <p>${item.content}</p>
        </div>
      </div>
      <div class="box3"></div>
      `
            } else {
              return ` <div class="touxiang">
        <div class="touxiangkuang1">
          <div class="hezi">
            <img src="./img/default-avatar.png" alt="">
            <span>${item.user.nick_name}</span>
            <span class="iconfont icon-xingxing"></span>
  
          </div>
          <div class="hezi2">
            <span class="for">${item.create_time}</span>
          </div>

        </div>
      </div>
      <div class="neirong">
        <div class="neirong1">
          <p>${item.content}</p>
        </div>
      </div>
      <div class="box3" style="height:5vw;"></div>
      `
            }
          }
        }).join('')
      })
      // 渲染  中评 
      document.querySelectorAll('.pingjia ul li a')[2].addEventListener('click', async function () {
        const quanbu = await axios({ url: `http://cba.itlike.com/public/index.php?s=/api/comment/list&scoreType=20&goodsId=${goodsId}&page=1` })
        console.log(quanbu.data.data.list.data)
        document.querySelector('.dada').innerHTML = quanbu.data.data.list.data.map(function (item) {
          if (item.images.length === 1) {
            if (item.score == 10) {
              return ` <div class="touxiang">
        <div class="touxiangkuang1">
          <div class="hezi">
            <img src="./img/default-avatar.png" alt="">
            <span>${item.user.nick_name}</span>
            <span class="iconfont icon-xingxing"></span>
            <span class="iconfont icon-xingxing"></span>
            <span class="iconfont icon-xingxing"></span>
            <span class="iconfont icon-xingxing"></span>
            <span class="iconfont icon-xingxing"></span>
          </div>
          <div class="hezi2">
            <span class="for">${item.create_time}</span>
          </div>

        </div>
      </div>
      <div class="neirong">
        <div class="neirong1">
          <p>${item.content}</p>
        </div>
      </div>
      <div class="box3">
        <img src=${item.images.length === 1 ? item.images[0].image_url : ""} alt="">
      </div>`
            }
            else if (item.score == 20) {
              return ` <div class="touxiang">
        <div class="touxiangkuang1">
          <div class="hezi">
            <img src="./img/default-avatar.png" alt="">
            <span>${item.user.nick_name}</span>
            <span class="iconfont icon-xingxing"></span>
            <span class="iconfont icon-xingxing"></span>
            <span class="iconfont icon-xingxing"></span>
         
          </div>
          <div class="hezi2">
            <span class="for">${item.create_time}</span>
          </div>

        </div>
      </div>
      <div class="neirong">
        <div class="neirong1">
          <p>${item.content}</p>
        </div>
      </div>
      <div class="box3">
        <img src=${item.images.length === 1 ? item.images[0].image_url : ""}  alt="">
      </div>`
            } else {
              return ` <div class="touxiang">
        <div class="touxiangkuang1">
          <div class="hezi">
            <img src="./img/default-avatar.png" alt="">
            <span>${item.user.nick_name}</span>
            <span class="iconfont icon-xingxing"></span>
  
          </div>
          <div class="hezi2">
            <span class="for">${item.create_time}</span>
          </div>

        </div>
      </div>
      <div class="neirong">
        <div class="neirong1">
          <p>${item.content}</p>
        </div>
      </div>
      <div class="box3">

        <img src=${item.images.length === 1 ? item.images[0].image_url : ""}  alt="">
      </div>`
            }


          } else {

            if (item.score == 10) {
              return ` <div class="touxiang">
        <div class="touxiangkuang1">
          <div class="hezi">
            <img src="./img/default-avatar.png" alt="">
            <span>${item.user.nick_name}</span>
            <span class="iconfont icon-xingxing"></span>
            <span class="iconfont icon-xingxing"></span>
            <span class="iconfont icon-xingxing"></span>
            <span class="iconfont icon-xingxing"></span>
            <span class="iconfont icon-xingxing"></span>
          </div>
          <div class="hezi2">
            <span class="for">${item.create_time}</span>
          </div>

        </div>
      </div>
      <div class="neirong">
        <div class="neirong1">
          <p>${item.content}</p>
        </div>
      </div>
      <div class="box3"></div>
    `
            }
            else if (item.score == 20) {
              return ` <div class="touxiang">
        <div class="touxiangkuang1">
          <div class="hezi">
            <img src="./img/default-avatar.png" alt="">
            <span>${item.user.nick_name}</span>
            <span class="iconfont icon-xingxing"></span>
            <span class="iconfont icon-xingxing"></span>
            <span class="iconfont icon-xingxing"></span>
         
          </div>
          <div class="hezi2">
            <span class="for">${item.create_time}</span>
          </div>

        </div>
      </div>
      <div class="neirong">
        <div class="neirong1">
          <p>${item.content}</p>
        </div>
      </div>
      <div class="box3"></div>
      `
            } else {
              return ` <div class="touxiang">
        <div class="touxiangkuang1">
          <div class="hezi">
            <img src="./img/default-avatar.png" alt="">
            <span>${item.user.nick_name}</span>
            <span class="iconfont icon-xingxing"></span>
  
          </div>
          <div class="hezi2">
            <span class="for">${item.create_time}</span>
          </div>

        </div>
      </div>
      <div class="neirong">
        <div class="neirong1">
          <p>${item.content}</p>
        </div>
      </div>
      <div class="box3" style="height:5vw;"></div>
      `
            }
          }
        }).join('')
      })

      // 渲染 差评
      document.querySelectorAll('.pingjia ul li a')[3].addEventListener('click', async function () {
        const quanbu = await axios({ url: `http://cba.itlike.com/public/index.php?s=/api/comment/list&scoreType=30&goodsId=${goodsId}&page=1` })
        console.log(quanbu.data.data.list.data)
        document.querySelector('.dada').innerHTML = quanbu.data.data.list.data.map(function (item) {
          if (item.images.length === 1) {
            if (item.score == 10) {
              return ` <div class="touxiang">
        <div class="touxiangkuang1">
          <div class="hezi">
            <img src="./img/default-avatar.png" alt="">
            <span>${item.user.nick_name}</span>
            <span class="iconfont icon-xingxing"></span>
            <span class="iconfont icon-xingxing"></span>
            <span class="iconfont icon-xingxing"></span>
            <span class="iconfont icon-xingxing"></span>
            <span class="iconfont icon-xingxing"></span>
          </div>
          <div class="hezi2">
            <span class="for">${item.create_time}</span>
          </div>

        </div>
      </div>
      <div class="neirong">
        <div class="neirong1">
          <p>${item.content}</p>
        </div>
      </div>
      <div class="box3">
        <img src=${item.images.length === 1 ? item.images[0].image_url : ""} alt="">
      </div>`
            }
            else if (item.score == 20) {
              return ` <div class="touxiang">
        <div class="touxiangkuang1">
          <div class="hezi">
            <img src="./img/default-avatar.png" alt="">
            <span>${item.user.nick_name}</span>
            <span class="iconfont icon-xingxing"></span>
            <span class="iconfont icon-xingxing"></span>
            <span class="iconfont icon-xingxing"></span>
         
          </div>
          <div class="hezi2">
            <span class="for">${item.create_time}</span>
          </div>

        </div>
      </div>
      <div class="neirong">
        <div class="neirong1">
          <p>${item.content}</p>
        </div>
      </div>
      <div class="box3">
        <img src=${item.images.length === 1 ? item.images[0].image_url : ""}  alt="">
      </div>`
            } else {
              return ` <div class="touxiang">
        <div class="touxiangkuang1">
          <div class="hezi">
            <img src="./img/default-avatar.png" alt="">
            <span>${item.user.nick_name}</span>
            <span class="iconfont icon-xingxing"></span>
  
          </div>
          <div class="hezi2">
            <span class="for">${item.create_time}</span>
          </div>

        </div>
      </div>
      <div class="neirong">
        <div class="neirong1">
          <p>${item.content}</p>
        </div>
      </div>
      <div class="box3">

        <img src=${item.images.length === 1 ? item.images[0].image_url : ""}  alt="">
      </div>`
            }


          } else {

            if (item.score == 10) {
              return ` <div class="touxiang">
        <div class="touxiangkuang1">
          <div class="hezi">
            <img src="./img/default-avatar.png" alt="">
            <span>${item.user.nick_name}</span>
            <span class="iconfont icon-xingxing"></span>
            <span class="iconfont icon-xingxing"></span>
            <span class="iconfont icon-xingxing"></span>
            <span class="iconfont icon-xingxing"></span>
            <span class="iconfont icon-xingxing"></span>
          </div>
          <div class="hezi2">
            <span class="for">${item.create_time}</span>
          </div>

        </div>
      </div>
      <div class="neirong">
        <div class="neirong1">
          <p>${item.content}</p>
        </div>
      </div>
      <div class="box3"></div>
    `
            }
            else if (item.score == 20) {
              return ` <div class="touxiang">
        <div class="touxiangkuang1">
          <div class="hezi">
            <img src="./img/default-avatar.png" alt="">
            <span>${item.user.nick_name}</span>
            <span class="iconfont icon-xingxing"></span>
            <span class="iconfont icon-xingxing"></span>
            <span class="iconfont icon-xingxing"></span>
         
          </div>
          <div class="hezi2">
            <span class="for">${item.create_time}</span>
          </div>

        </div>
      </div>
      <div class="neirong">
        <div class="neirong1">
          <p>${item.content}</p>
        </div>
      </div>
      <div class="box3"></div>
      `
            } else {
              return ` <div class="touxiang">
        <div class="touxiangkuang1">
          <div class="hezi">
            <img src="./img/default-avatar.png" alt="">
            <span>${item.user.nick_name}</span>
            <span class="iconfont icon-xingxing"></span>
  
          </div>
          <div class="hezi2">
            <span class="for">${item.create_time}</span>
          </div>

        </div>
      </div>
      <div class="neirong">
        <div class="neirong1">
          <p>${item.content}</p>
        </div>
      </div>
      <div class="box3" style="height:5vw;"></div>
      `
            }
          }
        }).join('')
      })























    }

    ping()


  </script>
</body>

</html>